package top.zhuyougu.demo1.controler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.zhuyougu.demo1.pojo.User;
import top.zhuyougu.demo1.service.UserService;

import java.util.List;

@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("findAll")
    public List<User> findAll(){
        return userService.findAll();
    }

    @GetMapping("teatA")
    public List<User> findUserIdAndCourse(){
        return userService.getAll();
    }

    @GetMapping("findPage")
    public List<User> findPage(@RequestParam("page")Integer page,
                               @RequestParam("pageSize")Integer pageSize){
        return userService.findPage(page,pageSize);
    }

}
